import request from '@/utils/request'

// 查询优惠券列表
export function listCouponmanage(query) {
  return request({
    url: '/coupon/coupon/couponList',
    method: 'get',
  })
}

// 查询优惠券详细
export function getCouponmanage(couponId) {
  return request({
    url: '/coupon/coupon/getCouponById/' + couponId,
    method: 'get'
  })
}

// 新增优惠券
export function addCouponmanage(data) {
  return request({
    url: '/coupon/coupon/addcoupon',
    method: 'post',
    data: data
  })
}

// 直接发放优惠券
export function givecoupon(data){
    return request({
    url: '/coupon/coupon/giveCoupon',
    method: 'post',
    data: data
  })
}

// 修改优惠券
export function updateCouponmanage(data) {
  return request({
    url: '/coupon/coupon/updateCoupon',
    method: 'post',
    data: data
  })
}

// 删除优惠券
export function delCouponmanage(couponId) {
  return request({
    url: '/coupon/coupon/deletecoupon/' + couponId,
    method: 'get'
  })
}
